<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Like-喜欢婚礼. 让婚礼从此不同！全国首家鲜花一站式婚礼服务平台 </title>
		<meta name="keywords" content="喜欢婚礼,婚礼学堂,嘉田美合,婚礼图片,婚礼视频,婚礼VR,婚礼,婚庆" />
		<meta name="description" content="喜欢婚礼平台,以婚礼机构为切入点，以婚礼用花为切入口，整合线下婚礼资源,鲜花,婚礼用品,舞美,人员等" />
		<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1,user-scalable=no">

		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta http-equiv="X-UA-Compatible" content="IE=edge chrome=1" />
		<meta name="renderer" content="webkit">
		<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
		<link rel="stylesheet" type="text/css" href="../../statics/css/cssinit.css" />
		<style type="text/css">
			.header {
				position: fixed;
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;
				height: 50px;
				padding: 0 15px;
				box-sizing: border-box;
				background-color: #f5f5f5;
				box-shadow: inset 0px -1px 1px -1px #969696;
				z-index: 2;
				top: 0;
			}
			
			.header #backIcon {
				width: 46.5px;
				display: flex;
				align-items: center;
				width: 50px;
			}
			
			.header #backIcon span {
				font-size: 14px;
			}
			
			.header .backIcon {
				width: 10px;
				height: 10px;
				/*border: 2px solid #d9b96e;*/
				border: 2px solid #969696;
				border-bottom: none;
				border-left: none;
				transform: rotate(-135deg);
				-ms-transform: rotate(-135deg);
				-moz-transform: rotate(-135deg);
				-webkit-transform: rotate(-135deg);
				-o-transform: rotate(-135deg);
			}
			
			.header .content {
				font-size: 18px;
				color: black;
			}
			
			.header .custom {
				width: 50px;
				text-align: right;
			}
			
			.submit {
				width: 100%;
				padding: 0 25px;
				box-sizing: border-box;
				margin-top: 48px;
			}
			
			.submit input {
				font-size: 15px;
				width: 100%;
				color: white;
				background: #66bcd5;
				height: 40px;
				line-height: 43px;
				text-align: center;
				border-radius: 25px;
			}
			
			.main div {
				height: 50px;
				line-height: 50px;
				border-bottom: 1px solid #D6D6D6;
				font-size: 13px;
				color: #6d6d6d;
				padding: 0 16px;
			}
			
			.main div span {
				width: 50px;
				display: inline-block;
				height: 50px;
			}
			
			.main div select {
				height: 50px;
				line-height: 50px;
				border: none;
				width: calc(100% - 55px);
				box-sizing: border-box;
			}
			
			.main .fixed {
				background-color: #F5F5F5;
				font-size: 14px;
				color: #303030;
			}
			
			.main .fixed span:first-child {
				font-size: 11px;
				color: #A1A1A1;
			}
			
			select {
				/*Chrome和Firefox里面的边框是不一样的，所以复写了一下*/
				/*border: solid 1px #000;*/
				/*很关键：将默认的select选择框样式清除*/
				appearance: none;
				-moz-appearance: none;
				-webkit-appearance: none;
				/*将背景改为红色*/
				background: url(../../statics/images/cityWide/aaa.png) no-repeat right center;
				background-size: 4%;
				/*加padding防止文字覆盖*/
				padding-right: 14px;
			}
			/*清除ie的默认选择框样式清除，隐藏下拉箭头*/
			
			select::-ms-expand {
				display: none;
			}
		</style>
	</head>

	<body>
		<header class="header">
			<div id="backIcon">
				<div class="backIcon"></div><span>返回</span>
			</div>
			<div class="content">选择城市</div>
			<div class="custom"></div>
		</header>
		<div style="width: 100%;height: 50px;"></div>
		<div class="main">
			<div class="fixed">
				<span>当前定位</span>
				<span id="city">杭州市</span>
				

			</div>
			<div class="province">
				<span>省&nbsp;&nbsp;&nbsp;&nbsp;份</span>
				<select name="input_province" id="input_province" class="form-control"></select>

			</div>
			<div class="city">
				<span>城&nbsp;&nbsp;&nbsp;&nbsp;市</span>
				<select name="input_city" id="input_city" class="form-control">
					
				</select>

			</div>
			<div class="canton">
				<span>行政区</span>
				<select name="input_area" id="input_area" class="form-control">
				</select>

			</div>
		</div>
		<div class="submit">
			<input type="button" name="" id="login" value="确定" />
		</div>

	</body>
	<script src="../../statics/js/jquery-1.12.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../statics/js/common.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../statics/bowersrc/fastclick.js" type="application/javascript" charset="utf-8"></script>
	<script src="../../statics/bowersrc/pdata2.js" type="text/javascript" charset="utf-8"></script>

	<script type="text/javascript">
		$(function() {
			new FastClick(document.body);
		})
	</script>

	<script type="text/javascript">
		$(function() {
			var selectProvince="浙江省";
			var selectCity="杭州市";
			var selectArea="西湖区";

			var provinceID = 11;
			var cityID = 166;
			var areaID = 1272;
			var html = "";
			$("#input_city").append(html);
			$("#input_area").append(html);
			$.each(pdata, function(idx, item) {
				if(parseInt(item.level) == 0) {
					html += "<option value='" + item.names + "' exid='" + item.code + "'>" + item.names + "</option>";
				}
			});
			$("#input_province").append(html);

			$("#input_province").change(function() {
				if($(this).val() == "") return;
				$("#input_city option").remove();
				$("#input_area option").remove();
				var provinceCode = $(this).find("option:selected").attr("exid").toString();
				var code = provinceCode.substring(0, 2);
				var html = "<option >请选择</option>";
				$("#input_area").append(html);
				$.each(pdata, function(idx, item) {
					if(item.code == provinceCode) {
						provinceID = item.id;
					}
					if(parseInt(item.level) == 1 && code == item.code.toString().substring(0, 2)) {
						html += "<option value='" + item.names + "' exid='" + item.code + "'>" + item.names + "</option>";
					}
				});
				$("#input_city").append(html);
			});

			$("#input_city").change(function() {
				if($(this).val() == "") return;
				$("#input_area option").remove();
				var cityCode = $(this).find("option:selected").attr("exid").toString();
				var code = cityCode.substring(0, 4);
				var html = "<option >请选择</option>";
				$.each(pdata, function(idx, item) {

					if(item.code == cityCode) {
						cityID = item.id;
						selectCity=item.names;
						

					}
					if(parseInt(item.level) == 2 && code == item.code.toString().substring(0, 4)) {
						html += "<option value='" + item.names + "' exid='" + item.code + "'>" + item.names + "</option>";
					}
				});
				$("#input_area").append(html);
			});
			$("#input_area").change(function() {
				var areaCode = $(this).find("option:selected").attr("exid").toString();
				$.each(pdata, function(idx, item) {
					if(item.code == areaCode) {
						areaID = item.id;

					}
				})
			});
			//绑定
			$("#input_province").val("浙江省");
			$("#input_province").change();
			$("#input_city").val("杭州市");
			$("#input_city").change();
			$("#input_area").val("西湖区");
//			$("#input_city").change();
			$(".submit").on("click", function() {
				console.log(selectCity);
				console.log(provinceID, cityID, areaID);
				localStorage.city = selectCity;
				window.location="cityWide.html";
			})
		});
		$("#backIcon").on("click", function() {
			window.history.back(-1)
		})
	</script>

</html>